package com.supor.aiot.home.bean;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.supor.aiot.home.R;
import com.supor.aiot.home.ui.device.config.WifiConfigContainer;


public class ConfigItem {
    /**
     * 设备名称
     */
    public TextView tvDevice;
    /**
     * 设备图片
     */
    public ImageView ivDevice;
    /**
     * 第一步ImageView
     */
    public ImageView ivStepStatus1;
    /**
     * 第一步loading
     */
    public ProgressBar indicatorStep1;
    /**
     * 第一步text
     */
    public TextView tvStep1;
    /**
     * 第一步竖线
     */
    public View tvConfigLine1;
    /**
     * 第二步ImageView
     */
    public ImageView ivStepStatus2;
    /**
     * 第二步loading
     */
    public ProgressBar indicatorStep2;
    /**
     * 第二步text
     */
    public TextView tvStep2;
    /**
     * 第二步竖线
     */
    public View tvConfigLine2;
    /**
     * 第三步ImageView
     */
    public ImageView ivStepStatus3;
    /**
     * 第三步loading
     */
    public ProgressBar indicatorStep3;
    /**
     * 第三步text
     */
    public TextView tvStep3;
    /**
     * 第三步倒计时
     */
    public TextView tvStep3Countdown;
    /**
     * 失败原因View
     */
    public View llConfigFailed;
    /**
     * 失败原因设备
     */
    public TextView tvDeviceFailed;
    /**
     * 失败原因
     */
    public TextView tvCheckReason;

    public View root;
    public int index;


    public ConfigItem(Context context, int index) {
        root = LayoutInflater.from(context).inflate(R.layout.item_wifi_config, null);
        tvDevice = root.findViewById(R.id.tv_device);
        ivDevice = root.findViewById(R.id.iv_device);
        ivStepStatus1 = root.findViewById(R.id.iv_step_status1);
        indicatorStep1 = root.findViewById(R.id.indicator_step1);
        tvStep1 = root.findViewById(R.id.tv_step1);
        tvConfigLine1 = root.findViewById(R.id.tv_config_line1);
        ivStepStatus2 = root.findViewById(R.id.iv_step_status2);
        indicatorStep2 = root.findViewById(R.id.indicator_step2);
        tvStep2 = root.findViewById(R.id.tv_step2);
        tvConfigLine2 = root.findViewById(R.id.tv_config_line2);
        ivStepStatus3 = root.findViewById(R.id.iv_step_status3);
        indicatorStep3 = root.findViewById(R.id.indicator_step3);
        tvStep3 = root.findViewById(R.id.tv_step3);
        tvStep3Countdown = root.findViewById(R.id.tv_step3_countdown);
        llConfigFailed = root.findViewById(R.id.ll_config_failed);
        tvDeviceFailed = root.findViewById(R.id.tv_device_failed);
        tvCheckReason = root.findViewById(R.id.tv_check_reason);
        this.index = index;
    }

    public void setViewClickListener(WifiConfigContainer.ViewClick viewClick) {
        tvCheckReason.setOnClickListener(viewClick);
    }
}
